package StudyCode.summary.textfile;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class WriteStringsToFile {
	public static void main(String[] argv) {
		try {
			ArrayList<String> strings = new ArrayList<>();

			for (int i = 0; i < 10; i++) {
				strings.add("www.tah1986.com");
			}

			BufferedWriter out = new BufferedWriter(new FileWriter("E:/Copy/test1.txt", true));
			for (String string : strings) {
				out.write(string);
			}
			out.close();
			System.out.println("将字符串数组或集合写入到文件成功");
		} catch (IOException e) {
		}
	}
}
